package com.luckymore.ydd.app.model;

import com.base.model.Bean2Json;

import org.json.JSONArray;

import java.util.ArrayList;
import java.util.List;

public class MAppUser {

	static public class MUserList extends Bean2Json<MUserList> {
		private static final long serialVersionUID = 1L;
		private List<MUser> user = new ArrayList<MUser>();
		public List<MUser> getUser() {
			return this.user;
		}
		public void setUser(List<MUser> user) {
			this.user=user;
		}
		public MUserList build() throws Exception {
			JSONArray jauser = data.getJSONArray("user_");
			for(int i = 0, len = jauser.length(); i < len; i++) {
				MUser n = new MUser();n.setData(jauser.getJSONObject(i));this.user.add(n);
			}
			return this;
		}
		public void build(Bean2Json data) {
			this.setUser(((MUserList)data).getUser());
		}

	}

	static public class MUser extends Bean2Json<MUser> {
		private static final long serialVersionUID = 1L;
		private String id;
		private String account;
		private String headImg;
		private String nickname;
		private String verify;
		private int sex;
		private String email;
		private String phone;
		private int isV;
		private int restDay;
		private int startDay;
		private String subjectEng;
		private String subjectPolity;
		private String subjectMath;
		private String subjectMajor1;
		private String subjectMajor2;
		private int hasPassword;
        private String password;
        private String createTime;
        private String passwordEncrypt;
        private String passwordShow;
		public String getId() {
			return this.id;
		}
		public void setId(String id) {
			this.id=id;
		}
		public String getAccount() {
			return this.account;
		}
		public void setAccount(String account) {
			this.account=account;
		}
		public String getHeadImg() {
			return this.headImg;
		}
		public void setHeadImg(String headImg) {
			this.headImg=headImg;
		}
		public String getNickname() {
			return this.nickname;
		}
		public void setNickname(String nickname) {
			this.nickname=nickname;
		}
		public String getVerify() {
			return this.verify;
		}
		public void setVerify(String verify) {
			this.verify=verify;
		}
		public int getSex() {
			return this.sex;
		}
		public void setSex(int sex) {
			this.sex=sex;
		}
		public String getEmail() {
			return this.email;
		}
		public void setEmail(String email) {
			this.email=email;
		}
		public String getPhone() {
			return this.phone;
		}
		public void setPhone(String phone) {
			this.phone=phone;
		}
		public int getIsV() {
			return this.isV;
		}
		public void setIsV(int isV) {
			this.isV=isV;
		}
		public int getRestDay() {
			return this.restDay;
		}
		public void setRestDay(int restDay) {
			this.restDay=restDay;
		}
		public int getStartDay() {
			return this.startDay;
		}
		public void setStartDay(int startDay) {
			this.startDay=startDay;
		}
		public String getSubjectEng() {
			return this.subjectEng;
		}
		public void setSubjectEng(String subjectEng) {
			this.subjectEng=subjectEng;
		}
		public String getSubjectPolity() {
			return this.subjectPolity;
		}
		public void setSubjectPolity(String subjectPolity) {
			this.subjectPolity=subjectPolity;
		}
		public String getSubjectMath() {
			return this.subjectMath;
		}
		public void setSubjectMath(String subjectMath) {
			this.subjectMath=subjectMath;
		}
		public String getSubjectMajor1() {
			return this.subjectMajor1;
		}
		public void setSubjectMajor1(String subjectMajor1) {
			this.subjectMajor1=subjectMajor1;
		}
		public String getSubjectMajor2() {
			return this.subjectMajor2;
		}
		public void setSubjectMajor2(String subjectMajor2) {
			this.subjectMajor2=subjectMajor2;
		}
		public int getHasPassword() {
			return this.hasPassword;
		}
		public void setHasPassword(int hasPassword) {
			this.hasPassword=hasPassword;
		}
        public void setPassword(String password) {
            this.password=password;
        }
        public String getPassword() {
            return this.password;
        }

        public String getPasswordShow() {
            return passwordShow;
        }

        public void setPasswordShow(String passwordShow) {
            this.passwordShow = passwordShow;
        }

        public String getPasswordEncrypt() {
            return passwordEncrypt;
        }

        public void setPasswordEncrypt(String passwordEncrypt) {
            this.passwordEncrypt = passwordEncrypt;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public MUser build() throws Exception {
			this.setId(data.getString("id_"));
			this.setAccount(data.getString("account_"));
			this.setHeadImg(data.getString("headImg_"));
			this.setNickname(data.getString("nickname_"));
			this.setVerify(data.getString("verify_"));
			this.setSex(data.getInt("sex_"));
			this.setEmail(data.getString("email_"));
			this.setPhone(data.getString("phone_"));
			this.setIsV(data.getInt("isV_"));
			this.setRestDay(data.getInt("restDay_"));
			this.setStartDay(data.getInt("startDay_"));
			this.setSubjectEng(data.getString("subjectEng_"));
			this.setSubjectPolity(data.getString("subjectPolity_"));
			this.setSubjectMath(data.getString("subjectMath_"));
			this.setSubjectMajor1(data.getString("subjectMajor1_"));
			this.setSubjectMajor2(data.getString("subjectMajor2_"));
			this.setHasPassword(data.getInt("hasPassword_"));
            this.setCreateTime(data.getString("createTime_"));
            this.setPasswordShow(data.getString("password_"));
            this.setPasswordEncrypt(data.getString("passwordEncrypt_"));
			return this;
		}
		public void build(Bean2Json data) {
			this.setId(((MUser)data).getId());
			this.setAccount(((MUser)data).getAccount());
			this.setHeadImg(((MUser)data).getHeadImg());
			this.setNickname(((MUser)data).getNickname());
			this.setVerify(((MUser)data).getVerify());
			this.setSex(((MUser)data).getSex());
			this.setEmail(((MUser)data).getEmail());
			this.setPhone(((MUser)data).getPhone());
			this.setIsV(((MUser)data).getIsV());
			this.setRestDay(((MUser)data).getRestDay());
			this.setStartDay(((MUser)data).getStartDay());
			this.setSubjectEng(((MUser)data).getSubjectEng());
			this.setSubjectPolity(((MUser)data).getSubjectPolity());
			this.setSubjectMath(((MUser)data).getSubjectMath());
			this.setSubjectMajor1(((MUser)data).getSubjectMajor1());
			this.setSubjectMajor2(((MUser)data).getSubjectMajor2());
			this.setHasPassword(((MUser)data).getHasPassword());
            this.setPassword(((MUser)data).getPassword());
            this.setPasswordShow(((MUser)data).getPasswordShow());
            this.setPasswordEncrypt(((MUser)data).getPasswordEncrypt());
            this.setCreateTime(((MUser)data).getCreateTime());
		}

        @Override
        public String toString() {
            return "MUser{" +
                    "id='" + id + '\'' +
                    ", account='" + account + '\'' +
                    ", headImg='" + headImg + '\'' +
                    ", nickname='" + nickname + '\'' +
                    ", verify='" + verify + '\'' +
                    ", sex=" + sex +
                    ", email='" + email + '\'' +
                    ", phone='" + phone + '\'' +
                    ", isV=" + isV +
                    ", restDay=" + restDay +
                    ", startDay=" + startDay +
                    ", subjectEng='" + subjectEng + '\'' +
                    ", subjectPolity='" + subjectPolity + '\'' +
                    ", subjectMath='" + subjectMath + '\'' +
                    ", subjectMajor1='" + subjectMajor1 + '\'' +
                    ", subjectMajor2='" + subjectMajor2 + '\'' +
                    ", hasPassword=" + hasPassword +
                    ", password='" + password + '\'' +
                    ", createTime='" + createTime + '\'' +
                    ", passwordEncrypt='" + passwordEncrypt + '\'' +
                    ", passwordShow='" + passwordShow + '\'' +
                    '}';
        }
    }

	static public class Mupdateself extends Bean2Json<Mupdateself> {
		private static final long serialVersionUID = 1L;
		private String id;
		private String version;
		private String url;
		private String desc;
		public String getId() {
			return this.id;
		}
		public void setId(String id) {
			this.id=id;
		}
		public String getVersion() {
			return this.version;
		}
		public void setVersion(String version) {
			this.version=version;
		}
		public String getUrl() {
			return this.url;
		}
		public void setUrl(String url) {
			this.url=url;
		}
		public String getDesc() {
			return this.desc;
		}
		public void setDesc(String desc) {
			this.desc=desc;
		}
		public Mupdateself build() throws Exception {
			this.setId(data.getString("id_"));
			this.setVersion(data.getString("version_"));
			this.setUrl(data.getString("url_"));
			this.setDesc(data.getString("desc_"));
			return this;
		}
		public void build(Bean2Json data) {
			this.setId(((Mupdateself)data).getId());
			this.setVersion(((Mupdateself)data).getVersion());
			this.setUrl(((Mupdateself)data).getUrl());
			this.setDesc(((Mupdateself)data).getDesc());
		}

	}


}
